package com.virtue.springboot.example.controller;

import com.virtue.springboot.example.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(Model model) {
        User user = new User();
        List<User> userList = user.selectAll();
        model.addAttribute("userList", userList);
        return "user/list";
    }


}
